home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / extra / helpful.zip / nis < prev    next >
Text File  |  1995-08-21  |  27KB  |  899 lines

  1.   The Linux NIS(YP)/NIS+/NYS HOWTO
  2.   Andrea Dell'Amico, Mitchum DSouza, Erwin Embsen, Peter Eriksson
  3.   v0.5, 24 January 1995
  4.  
  5.   1.  Glossary of Terms
  6.  
  7.   In this document a lot of acronyms are used. Here are the most
  8.   important acronyms and a brief explanation:
  9.  
  10.  
  11.      DBM
  12.         DataBase Management, a library of functions which maintain key-
  13.         content pairs in a data base.
  14.  
  15.  
  16.      DLL
  17.         Dynamically Linked Library, a library linked to an executable
  18.         program at run-time.
  19.  
  20.  
  21.      domainname
  22.         A name "key" that is used by NIS clients to be able to locate a
  23.         suitable NIS server that serves that domainname key. Please note
  24.         that this does not necessarily have anything at all to do with
  25.         the DNS "domain" (machine name) of the machine(s).
  26.  
  27.  
  28.      FTP
  29.         File Transfer Protocol, a protocol used to transfer files
  30.         between two computers.
  31.  
  32.  
  33.      libnsl
  34.         Name services library, a library of name service calls
  35.         (getpwnam, getservbyname, etc...) on SVR4 Unixes.
  36.  
  37.  
  38.      libsocket
  39.         Socket services library, a library for the socket service calls
  40.         (socket, bind, listen, etc...) on SVR4 Unixes.
  41.  
  42.  
  43.      NIS
  44.         Network Information Service, a service that provides
  45.         information, that has to be known throughout the network, to all
  46.         machines on the network. There is support for NIS in Linux's
  47.         standard libc library, which in the following text is referred
  48.         to as "traditional NIS".
  49.  
  50.  
  51.      NIS+
  52.         Network Information Service (Plus :-), essentially NIS on
  53.         steroids. NIS+ is designed by Sun Microsystems Inc. as a
  54.         replacement for NIS with better security and better handling of
  55.         _large_ installations.
  56.  
  57.  
  58.      NYS
  59.         This is the name of a project and stands for NIS+, YP and Switch
  60.         and is managed by Peter Eriksson <pen@lysator.liu.se>. It
  61.         contains among other things a complete reimplementation of the
  62.         NIS (=YP) code that uses the Name Services Switch functionality
  63.         of the NYS library.
  64.  
  65.  
  66.  
  67.      RPC
  68.         Remote Procedure Call. RPC routines allow C programs to make
  69.         procedure calls on other machines across the network.  When
  70.         people talk about RPC they most often mean the SunRPC variant.
  71.  
  72.  
  73.      YP Yellow Pages(tm), a registered trademark in the UK of British
  74.         Telecom plc.
  75.  
  76.  
  77.      TCP-IP
  78.         Transmission Control Protocol/Internet Protocol. It's a data
  79.         communication protocol often used on Unix machines.
  80.  
  81.  
  82.  
  83.   1.1.  Some General Information
  84.  
  85.   The next three lines are quoted from the Sun(tm) System & Network
  86.   Administration Manual:
  87.  
  88.  
  89.  
  90.            "NIS was formerly known as Sun Yellow Pages (YP) but
  91.             the name Yellow Pages(tm) is a registered trademark
  92.             in the United Kingdom of British Telecom plc and may
  93.             not be used without permission."
  94.  
  95.  
  96.  
  97.  
  98.   NIS stands for Network Information Service. It's purpose is to provide
  99.   information, that has to be known throughout the network, to all
  100.   machines on the network. Information likely to be distributed by NIS
  101.   is:
  102.  
  103.  
  104.   o  login names/passwords/home directories (/etc/passwd)
  105.  
  106.   o  group information (/etc/group)
  107.  
  108.   So, for example, if your password entry is recorded in the NIS passwd
  109.   database, you will be able to login on all machines on the net which
  110.   have the NIS client programs running.
  111.  
  112.   Sun is a trademark of Sun Microsystems, Inc. licensed to SunSoft, Inc.
  113.  
  114.  
  115.  
  116.   2.  Introduction
  117.  
  118.   More and more, Linux machines are installed as part of a network of
  119.   computers. To simplify network administration, most networks (mostly
  120.   Sun-based networks) run the Network Information Service. Linux
  121.   machines can take full advantage of existing NIS service or provide
  122.   NIS service themselves. It can also (with the NYS library) act as a
  123.   limited NIS+ client.
  124.  
  125.   This document tries to answer questions about setting up NIS(YP) on
  126.   your Linux machine. It does not talk about how to set up NIS+. Don't
  127.   forget to read section 5.1, The RPC Portmapper.
  128.  
  129.  
  130.  
  131.  
  132.  
  133.   2.1.  New versions of this document
  134.  
  135.   New versions of this document will be posted periodically (about every
  136.   month) to the newsgroups comp.os.linux.announce and
  137.   comp.os.linux.misc.  The document is archived on a number of Linux FTP
  138.   sites, including sunsite.unc.edu in /pub/Linux/docs/HOWTO.
  139.  
  140.  
  141.  
  142.   2.2.  Disclaimer
  143.  
  144.   Although this document has been put together to the best of our
  145.   knowledge it may, and probably does contain errors. Please read any
  146.   README files that are bundled with any of the various pieces of
  147.   software described in this document for more detailed and accurate
  148.   information. We will attempt to keep this document as error free as
  149.   possible.
  150.  
  151.  
  152.  
  153.   2.3.  Feedback
  154.  
  155.   If you have any comments, questions or suggestions please email them
  156.   to Erwin Embsen <erwin@nioz.nl>. Definitely contact him if you find
  157.   errors or obvious omissions.
  158.  
  159.  
  160.  
  161.   2.4.  Acknowledgements
  162.  
  163.   We would like to thank all the people who have contributed (directly
  164.   or indirectly) to this document. In alphabetical order:
  165.  
  166.  
  167.  
  168.        Andrea Dell'Amico <adellam@di.unipi.it>
  169.        Mitchum DSouza    <Mitch.Dsouza@Dubai.Sun.COM>
  170.        Erwin Embsen      <erwin@nioz.nl>
  171.        Byron A Jeff      <byron@cc.gatech.edu>
  172.        Peter Eriksson    <pen@lysator.liu.se>
  173.  
  174.  
  175.  
  176.  
  177.   Theo de Raadt <deraadt@fsa.ca> is responsible for the original yp-
  178.   clients code.  Swen Thuemmler <swen@uni-paderborn.de> ported the yp-
  179.   clients code to Linux and also ported the yp-routines in libc (again
  180.   based on Theo's work).
  181.  
  182.  
  183.  
  184.   3.  NIS or NIS+ ?
  185.  
  186.   The choice between NIS and NIS+ is easy - use NIS if you don't have to
  187.   use NIS+ or have severe security needs. NIS+ is _much_ more
  188.   problematic to administer (it's pretty easy to handle on the client
  189.   side, but the server side is horrible). Another problem is that the
  190.   support for NIS+ under Linux is still under developement - one major
  191.   thing it still lacks is support for data encryption/authentication
  192.   which is _the_ major thing why anyone would want to use NIS+...
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.   3.1.  Traditional NIS or the NYS library ?
  200.  
  201.   The choice between Traditional NIS or the NIS code in the NYS library
  202.   is a choice between laziness and maturity vs. flexibility and love of
  203.   adventure.
  204.  
  205.   The "traditional NIS" code is in the standard C library and has been
  206.   around longer and sometimes suffers from it's age and slight
  207.   inflexibility.
  208.  
  209.   The NIS code in the NYS library, on the other hand requires you either
  210.   to recompile and relink all your programs to the libnsl library, or
  211.   recompile the libc library to include the libnsl code into the libc
  212.   library (or maybe you can go get a precompiled version of libc from
  213.   someone who has already done it).
  214.  
  215.   Another difference is that the traditional NIS code has some support
  216.   for NIS Netgroups, which the NYS code doesn't (yet). On the other hand
  217.   the NYS code allows you to handle Shadow Passwords in a transparent
  218.   way.
  219.  
  220.  
  221.  
  222.   4.  How it works
  223.  
  224.   Within a network there must be at least one machine acting as a NIS
  225.   server. You can have multiple NIS servers, each serving different NIS
  226.   "domains" - or you can have cooperating NIS servers, where one is said
  227.   to be the master NIS server, and all the other are so-called slave NIS
  228.   servers (for a certain NIS "domain", that is!) - or you can have a mix
  229.   of them...
  230.  
  231.   Slave servers only have copies of the NIS databases and receive these
  232.   copies from the master NIS server whenever changes are made to the
  233.   master's databases.  Depending on the number of machines in your
  234.   network and the reliability of your network, you might decide to
  235.   install one or more slave servers.  Whenever a NIS server goes down or
  236.   is too slow in responding to requests, a NIS client connected to that
  237.   server will try to find one that is up or quicker.
  238.  
  239.   NIS databases are in so-called DBM format, derived from ASCII
  240.   databases.  For example, the files /etc/passwd and /etc/group can be
  241.   directly converted to DBM format using ASCII-to-DBM translation
  242.   software ("dbload", it's included with the server software). The
  243.   master NIS server should have both, the ASCII databases and the DBM
  244.   databases.
  245.  
  246.   Slave servers  will be notified of any change to the NIS maps, (via
  247.   the "yppush" program), and automatically retrieve the necessary
  248.   changes in order to synchronize their databases. NIS clients does not
  249.   need to do this since they always talks to the NIS server to read the
  250.   information stored in it's DBM databases.
  251.  
  252.   The author of the YP clients for linux has informed us that the newest
  253.   ypbind (from yp-clients.tar.gz) is able to get the server from a
  254.   configuration file - thus no need to broadcast (which is insecure -
  255.   due to the fact that anyone may install a NIS server and answer the
  256.   broadcast queries...)
  257.  
  258.  
  259.  
  260.  
  261.   5.  What do you need to set up NIS?
  262.  
  263.  
  264.  
  265.   5.1.  The RPC Portmapper
  266.  
  267.   To run any of the software mentioned below you will need to run the
  268.   program /usr/sbin/rpc.portmap. Some Linux distributions already have
  269.   the code in /etc/rc.d/rc.inet2 to start up this daemon.  All you have
  270.   to do is comment it out and reboot your Linux machine to activate it.
  271.  
  272.   The RPC portmapper (portmap(8c)) is a server that converts RPC program
  273.   numbers into TCP/IP (or UDP/IP) protocol port numbers. It must be
  274.   running in order to make RPC calls (which is what the NIS client
  275.   software does) to RPC servers (like a NIS server) on that machine.
  276.   When an RPC server is started, it will tell portmap what port number
  277.   it is listening to, and what RPC program numbers it is prepared to
  278.   serve.  When a client wishes to make an RPC call to a given program
  279.   number, it will first contact portmap on the server machine to
  280.   determine the port number where RPC packets should be sent.
  281.  
  282.   Normally, standard RPC servers are started by inetd(8C), so portmap
  283.   must be started before inetd is invoked.
  284.  
  285.  
  286.  
  287.   5.2.  Determine whether you are a Server, Slave or Client.
  288.  
  289.   To answer this question you have to consider two cases:
  290.  
  291.  
  292.   1. Your machine is going to be part of a network with existing NIS
  293.      servers
  294.  
  295.   2. You do not have any NIS servers in the network yet
  296.  
  297.   In the first case, you only need the client programs (ypbind, ypwhich,
  298.   ypcat, yppoll, ypmatch). The most important program is ypbind. This
  299.   program must be running at all times, that is, it should always appear
  300.   in the list of processes. It's a so-called daemon process and needs to
  301.   be started from the system's startup file (eg. /etc/rc.local).  As
  302.   soon as ypbind is running, your system has become a NIS client.
  303.  
  304.   In the second case, if you don't have NIS servers, then you will also
  305.   need a NIS server program (usually called ypserv). Section 6 describes
  306.   how to set up a NIS server on your Linux machine using the "ypserv"
  307.   implementation by Peter Eriksson (<pen@lysator.liu.se>). Note that
  308.   this implementation does NOT support the master-slave concept talked
  309.   about in section 3. Using this software, all your NIS servers will be
  310.   master servers. There is also another free NIS server available,
  311.   called "yps", written by Tobias Reber in Germany which does support
  312.   the master-slave concept, but has other limitations.
  313.  
  314.  
  315.  
  316.   5.3.  The Software
  317.  
  318.   The system library "/usr/lib/libc.a" (version 4.4.2 and better) or the
  319.   shared library "/usr/lib/libc.sa" and its related DLL contain all
  320.   necessary system calls to succesfully compile the NIS client and
  321.   server software.
  322.  
  323.   Some people reported that NIS only works with "/usr/lib/libc.a"
  324.   version 4.5.21 and better so if you want to play it safe don't user
  325.   older libc's.  The NIS client software can be obtained from:
  326.  
  327.  
  328.  
  329.  
  330.  
  331.     Site                   Directory                        File Name
  332.  
  333.     ftp.uni-paderborn.de   /pcsoft2/linux/local/yp          yp-clients.tar.gz
  334.     ftp.funet.fi           /pub/OS/Linux/BETA/NYS/clients   yp-clients.tar.gz
  335.     ftp.lysator.liu.se     /pub/NYS/clients                 yp-clients.tar.gz
  336.     sunsite.unc.edu        /pub/Linux/system/Network/admin  yp-clients.tar.gz
  337.  
  338.  
  339.  
  340.  
  341.   Once you obtained the software, please follow the instructions which
  342.   come with the software.
  343.  
  344.  
  345.  
  346.   5.4.  Setting up a NIS Client using Traditional NIS
  347.  
  348.   Assuming you have succesfully compiled the software you are now ready
  349.   to install the software. A suitable place for the ypbind daemon is the
  350.   directory /usr/sbin.
  351.  
  352.   You'll need to do this as root of course. The other binaries (ypwhich,
  353.   ypcat, yppoll, ypmatch) should go in a directory accessible by all
  354.   users, for example /usr/etc or /usr/local/bin.  It might be a good
  355.   idea to test ypbind before incorporating it in /etc/rc.d/rc.inet2.
  356.  
  357.   To test ypbind do the following:
  358.  
  359.  
  360.   o  Make sure you have your domain name set. If it is not set then
  361.      issue the command:
  362.  
  363.  
  364.  
  365.                    /bin/domainname-yp nis.domain
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.   where nis.domain should be some string, _NOT_ normally associated with
  373.   the domain name of your machine! The reason for this is that it makes
  374.   it a little harder for external crackers to retreive the password
  375.   database from your NIS servers. If you don't know what the NIS domain
  376.   name is on your network, ask your system/network administrator.
  377.  
  378.   o  Start up "/usr/sbin/rpc.portmap" if it is not already running.
  379.  
  380.   o  Create the directory "/var/yp" if it does not exist.
  381.  
  382.   o  Start up "/usr/sbin/ypbind"
  383.  
  384.   o  Use the command "rpcinfo -p localhost" to check if ypbind was able
  385.      to register its service with the portmapper. The rpcinfo should
  386.      produce something like:
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.          program vers proto   port
  398.           100000    2   tcp    111  portmapper
  399.           100000    2   udp    111  portmapper
  400.           100007    2   udp    637  ypbind
  401.           100007    2   tcp    639  ypbind
  402.           300019    1   udp    660
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.   o  You may also run "rpcinfo -u localhost ypbind". This command should
  410.      produce something like:
  411.  
  412.  
  413.  
  414.                program 100007 version 2 ready and waiting
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.   Finally, do not forget that for host lookups you must set (or add)
  422.   "nis" to the lookup order line in your /etc/host.conf file. Please
  423.   read the manpage "resolv+.8" for more details.
  424.  
  425.   At this point you should be able to use NIS client programs like
  426.   ypcat, etc...  For example, "ypcat passwd" will give you the entire
  427.   NIS password database.
  428.  
  429.   IMPORTANT: If you skipped the test procedure then make sure you have
  430.   set the domain name, and created the directory:
  431.  
  432.  
  433.  
  434.            /var/yp
  435.  
  436.  
  437.  
  438.  
  439.   This directory MUST exist for ypbind to start up succesfully.
  440.  
  441.   If the test worked you may now want to change the files /etc/rc.d/rc.M
  442.   and /etc/rc.d/rc.inet2 on your system so that ypbind will be started
  443.   up at boot time and your system will act as a NIS client. Edit the
  444.   file /etc/rc.d/rc.M and look for the commands which set the domain
  445.   name.  Change the domain name into the name of your domain. Also, edit
  446.   the file /etc/rc.d/rc.inet2, comment out the lines which start up the
  447.   rpc.portmap daemon, and add the following lines just after the place
  448.   where rpc.portmap is started:
  449.  
  450.  
  451.  
  452.            #
  453.            # Start the ypbind daemon
  454.            #
  455.            if [ -f ${NET}/ypbind -a -d /var/yp ]; then
  456.                echo -n " ypbind"
  457.                ${NET}/ypbind
  458.            fi
  459.  
  460.  
  461.  
  462.  
  463.   Unlike Sun's implementation of NIS you do not need to edit /etc/passwd
  464.   and /etc/group to take advantage of NIS. Sun's implementation needs a
  465.   line "+:*:0:0:::" in /etc/passwd and a line "+:*:0:" in /etc/group to
  466.   tell NIS to search the NIS password and group databases.
  467.  
  468.   IMPORTANT: Note that the command finger will report "no such user"
  469.   messages if you do not add the line "+:*:0:0:::" to /etc/passwd.
  470.   Putting the line "+:*:0:0:::" back in /etc/passwd fixes finger.
  471.  
  472.   Well, that's it. Reboot the machine and watch the boot messages to see
  473.   if ypbind is actually started.
  474.  
  475.   IMPORTANT: Note that the netgroup  feature is implemented starting
  476.   from libc 4.5.26. Netgroups allow access control for every machine and
  477.   every user in the NIS domain, and they require an entry like:
  478.  
  479.  
  480.  
  481.            +@this_machine_users
  482.  
  483.  
  484.  
  485.  
  486.   in /etc/passwd. But if you have a version of libc erlier than 4.5.26,
  487.   every  user  in  the  NIS password database can access your linux
  488.   machine if you run "ypbind".
  489.  
  490.  
  491.  
  492.   6.  What you need to set up NYS?
  493.  
  494.   6.1.  Determine whether you are a Server, Slave or Client.
  495.  
  496.   To answer this question you have to consider two cases:
  497.  
  498.  
  499.   o  Your machine is going to be part of a network with existing NIS
  500.      servers
  501.  
  502.   o  You do not have any NIS servers in the network yet
  503.  
  504.   In the first case you have two choices:
  505.  
  506.  
  507.   o  Either you relink all client and daemon programs with the NYS
  508.      library libnsl.so (or statically link them with libnsl.a). This
  509.      means adding the line:
  510.  
  511.  
  512.  
  513.                    LIBS=-lnsl
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.   to your Makefile signifing you want to link the Network Services
  521.   Library. Basically all network deamons and the "login" program need to
  522.   be recompiled.
  523.  
  524.   o  Or you can recompile the standard C library libc to include the NYS
  525.      client library functions into the normal libc library, and then
  526.      relink all statically linked programs (the dynamically linked
  527.      programs automatically get the new version of libc).  See section
  528.      6.5 below for more information about this option.
  529.   Similarly like in the case of traditional NIS, if you don't have NIS
  530.   servers, then you will also need a NIS server program (usually called
  531.   ypserv) and you have to designate one of the machines in your network
  532.   as a master NIS server. Again, you might want to set up at least one
  533.   slave server as well.
  534.  
  535.  
  536.  
  537.   6.2.  The Software
  538.  
  539.   You need to retrieve and compile the NYS services library libnsl.so.
  540.   If you don't have the DLL tools installed you may retrieve a
  541.   precompiled shared, static and stub library from the same site
  542.   mentioned below. Note, however, that the precompiled version may be
  543.   (and probably is) older than the latest source code release.
  544.  
  545.   The NYS library (source and precompiled version)  can be obtained
  546.   from:
  547.  
  548.  
  549.  
  550.            Site                Directory                      File Name
  551.  
  552.            ftp.lysator.liu.se  /pub/NYS/libs                  nys-0.27.4.tar.gz
  553.            ftp.lysator.liu.se  /pub/NYS/binaries/lib          libnsl.so.1.0.a26
  554.  
  555.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/libs    nys-0.27.4.tar.gz
  556.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/lib     libnsl.so.1.0.a26
  557.  
  558.  
  559.  
  560.  
  561.   Precompiled "login" and "su" programs may also be fetched from
  562.  
  563.  
  564.  
  565.            Site                Directory                      File Name
  566.  
  567.            ftp.lysator.liu.se  /pub/NYS/binaries/bin          login
  568.            ftp.lysator.liu.se  /pub/NYS/binaries/bin          su
  569.  
  570.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/bin     login
  571.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/bin     su
  572.  
  573.  
  574.  
  575.  
  576.   Similarly, example configuration files may be retrieved from
  577.  
  578.  
  579.  
  580.            Site                Directory                      File Name
  581.  
  582.            ftp.lysator.liu.se  /pub/NYS/binaries/etc          *conf
  583.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/etc     *conf
  584.  
  585.  
  586.  
  587.  
  588.   For compilation of the nsl library, please follow the instructions
  589.   which come with the software. If you wish to compile the shared DLL
  590.   library you must have the DLL tools installed in the standard place
  591.   (/usr/dll). The DLL tools (the package tools-2.11.tar.gz or later) can
  592.   be obtained from many sites.
  593.  
  594.  
  595.   6.3.  Setting up a NYS Client using NYS
  596.  
  597.   Unlike traditional NIS, there is no setting up required for a NIS
  598.   client. All that is required is that the NIS configuration file
  599.   (/etc/yp.conf) points to the correct server(s) for its information.
  600.   Also, the Name Services Switch configuration file (/etc/nsswitch.conf)
  601.   must be correctly set up.
  602.  
  603.   Please refer to the examples provided with the source code.
  604.  
  605.  
  606.  
  607.   6.4.  The nsswitch.conf File
  608.  
  609.   The Network Services switch file /etc/nsswitch.conf determines the
  610.   order of lookups performed when a certain piece of information is
  611.   requested, just like the /etc/host.conf file which determines the way
  612.   host lookups are performed. Again, look at at the example file
  613.   provided in the source distribution. For example, the line
  614.  
  615.  
  616.  
  617.            hosts: files nis dns
  618.  
  619.  
  620.  
  621.  
  622.   specifies that host lookup functions should first look in the local
  623.   /etc/hosts file, followed by a NIS lookup and finally thru the domain
  624.   name service (/etc/resolv.conf and named), at which point if no match
  625.   is found an error is returned.
  626.  
  627.  
  628.  
  629.   6.5.  Making your binaries NYS aware
  630.  
  631.   Instead of relinking each binary with the NYS library (libnsl.so), a
  632.   cleaner solution has been achieved by providing the user with the
  633.   ability to build a NYS aware libc. This means all you need to do is
  634.   recompile a new libc and replace your existing /lib/libc.so.x.y.z for
  635.   all (non-static compiled) programs to be NYS aware.
  636.  
  637.   This merge also gives you the advantage over the traditional NIS
  638.   implementation in the linux libc in that it allows transparent shadow
  639.   passwords support (via the /etc/nisswitch.conf file).
  640.  
  641.   Follow the simple steps below to rebuild a NYS aware libc.
  642.  
  643.  
  644.   o  Make sure you have the latest DLL tools installed. Refer to the the
  645.      GCC-FAQ for more info on where to get this.
  646.  
  647.   o  Get the latest libc sources. (again see GCC-FAQ)
  648.  
  649.   o  Get the latest nys sources from
  650.  
  651.  
  652.  
  653.                  ftp.lysator.liu.se:/pub/NYS/libs
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.   and extract it under this libc-linux source directory.  The current
  661.   NYS distribution is "nys-0.27.4.tar.gz".
  662.  
  663.   o  Do the ./configure as before and first answer "n" to the question
  664.  
  665.  
  666.  
  667.                  Values correct (y/n) [y] ?
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.   Then go thru all the other questions and the last question will now be
  675.  
  676.  
  677.  
  678.                  Build a NYS libc from nys-0.27 (y default) ?
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.   answer "y" to this.
  686.  
  687.   o  Then issue the command
  688.  
  689.  
  690.  
  691.                  % make
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.   The library generated after compilation is named something like
  699.  
  700.  
  701.  
  702.            libc.so.4.5.26
  703.  
  704.  
  705.  
  706.  
  707.   and placed under the directory jump/libc-nys. To install this library
  708.   our advise would be copying it to /lib with a name lexiographically
  709.   greater than the version number it currently has. Just appending the
  710.   letter "a" should do the trick.  For example:
  711.  
  712.  
  713.  
  714.            % cp jump/libc-nys/libc.so.4.5.26 /lib/libc.so.4.5.26a
  715.  
  716.  
  717.  
  718.  
  719.   Alternatively, append "nys" to it so you can quickly identify it.  Now
  720.   run the command
  721.  
  722.  
  723.  
  724.            % ldconfig
  725.  
  726.  
  727.   which will reset your cache to use the new library. The dynamic linker
  728.   strategy may be examined with the command "ldconfig -p".
  729.  
  730.   That's basically it. All your programs should now be NYS aware. Please
  731.   note that usually the program "login" is compiled static and thus
  732.   cannot access the new NYS functions from the NYS aware libc. You must
  733.   either recompile "login" without the -static flag, or else statically
  734.   link it to the libnsl.a library.
  735.  
  736.  
  737.  
  738.   7.  Setting up a NIS Server
  739.  
  740.   7.1.  The Server Program ypserv
  741.  
  742.   This document only describes how to set up the "ypserv" NIS server.
  743.   The "yps" server setup is similar, _but_ not exactly the same so
  744.   beware if you try to apply these instructions to "yps"!
  745.  
  746.   The NIS server software can be found on:
  747.  
  748.  
  749.  
  750.            Site                Directory                          File Name
  751.  
  752.            ftp.lysator.liu.se  /pub/NYS/servers                   ypserv-0.11.tar.gz
  753.            ftp.funet.fi        /pub/OS/Linux/BETA/NYS/servers     ypserv-0.11.tar.gz
  754.            mcsun.eu.net        /os/linux/BETA/NYS/servers         ypserv-0.11.tar.gz
  755.            ftp.univie.ac.at    /unix/system/linux/funet/BETA/NYS/servers
  756.                                                                   ypserv-0.11.tar.gz
  757.  
  758.  
  759.  
  760.  
  761.   The server setup is the same for both traditional NIS and NYS.
  762.  
  763.   Compile the software to generate the "ypserv", "dbcat" and "dbload"
  764.   programs.  Firstly, determine what files you require to be available
  765.   via NIS and then add or remove the appropriate entries to the
  766.   ypMakefile. Install the file ypMakefile into /var/yp as the file
  767.   Makefile.
  768.  
  769.   Now build the DBM files by typing:
  770.  
  771.  
  772.  
  773.            % cd /var/yp; make
  774.  
  775.  
  776.  
  777.  
  778.   Make sure the portmapper (rpc.portmap) is running, and start the
  779.   server "ypserv". The command
  780.  
  781.  
  782.  
  783.  
  784.            % rpcinfo -u localhost ypserv
  785.  
  786.  
  787.  
  788.  
  789.   should output something like
  790.  
  791.  
  792.  
  793.       program 100004 version 2 ready and waiting
  794.  
  795.  
  796.  
  797.  
  798.   That's it, your server is up and running.
  799.  
  800.  
  801.  
  802.   7.2.  The Program yppasswdd
  803.  
  804.   Whenever users change their passwords, the NIS password database and
  805.   probably other NIS databases, which depend on the NIS password
  806.   database, should be updated.  The program "yppasswdd" is a server that
  807.   handles password changes and makes sure that the NIS information will
  808.   be updated accordingly. The software for "yppasswdd" can be found on:
  809.  
  810.  
  811.  
  812.            Site                   Directory                      File Name
  813.  
  814.            ftp.lysator.liu.se    /pub/NYS                        yppasswdd-0.5.tar.gz
  815.            ftp.funet.fi          /pub/OS/Linux/BETA/NYS/servers  yppasswdd-0.5.tar.gz
  816.  
  817.  
  818.  
  819.  
  820.   Once you obtained the software, please follow the instructions which
  821.   come with the software.
  822.  
  823.  
  824.  
  825.   8.  Verifying the NIS/NYS Installation
  826.  
  827.   If everything is fine (as it should be), you should be able to verify
  828.   your installation with a few simple commands. Assuming, for example,
  829.   your passwd file is being supplied by NIS, the command
  830.  
  831.  
  832.  
  833.            % ypcat passwd
  834.  
  835.  
  836.  
  837.  
  838.   should give you the contents of your NIS passwd file. The command
  839.  
  840.  
  841.  
  842.            % ypmatch userid passwd
  843.  
  844.  
  845.  
  846.  
  847.   (where userid is the login name of an arbitrary user) should give you
  848.   the user's entry in the NIS passwd file. The "ypcat" and "ypmatch"
  849.   programs should be included with your distribution of traditional NIS
  850.   or NYS.
  851.  
  852.  
  853.  
  854.   9.  Common Problems and Troubleshooting NIS
  855.  
  856.   Here are some common problems reported by various users:
  857.  
  858.  
  859.   1. The libraries for 4.5.19 are broken. NIS won't work with it.
  860.  
  861.   2. If you upgrade the libraries from 4.5.19 to 4.5.24 then the su
  862.      command breaks. You need to get the su command from the slackware
  863.      1.2.0 distribution. Incidentally that's where you can get the
  864.      updated libraries.
  865.  
  866.   3. You could run into trouble with NIS and DNS on the same machine.
  867.      My DNS server occasionally will not bring up NIS. Haven't yet
  868.      tracked down why.
  869.  
  870.   4. When a NIS server goes down and comes up again ypbind starts
  871.      complaining with messages like:
  872.  
  873.  
  874.               yp_match: clnt_call:
  875.                           RPC: Unable to receive; errno = Connection refused
  876.  
  877.  
  878.  
  879.  
  880.   and logins are refused for those who are registered in the NIS
  881.   database. Try to login as root and if you succeed, then kill ypbind
  882.   and start it up again.
  883.  
  884.  
  885.  
  886.   10.  Frequently Asked Questions
  887.  
  888.   Most of your questions should be answered by now. If there are still
  889.   questions unanswered you might want to post a message to
  890.  
  891.  
  892.  
  893.            comp.os.linux.help
  894.  
  895.  
  896.  
  897.  
  898.   or contact one of the authors of this HOWTO.
  899.